# 导包
import time
from selenium import webdriver
from selenium.webdriver.common.by import By
# 创建浏览器驱动
driver = webdriver.Chrome()
# 获取访问页面
driver.get("http://121.43.169.97:8848/pageA.html")
# 放大浏览器
driver.maximize_window()
time.sleep(1)
# 模拟用户操作
# 获取用户名：通过标签ID、标签属性、标签class、标签名
# id定位
driver.find_element(by=By.CSS_SELECTOR, value="#userA").send_keys("admin")
# 属性定位
driver.find_element(by=By.CSS_SELECTOR, value="[name='passwordA']").send_keys('111111')
# class类定位
driver.find_element(by=By.CSS_SELECTOR, value=".telA").send_keys('13458888888')
# 多个class类定位
driver.find_element(by=By.CSS_SELECTOR, value=".emailA.dzyxA").send_keys('123456@qq.com')
# 标签定位
# driver.find_element(by=By.CSS_SELECTOR, value='button').click()

# driver.find_element(by=By.CSS_SELECTOR, value='#alerta').click()

driver.find_element(by=By.XPATH, value=".//*[@id='selectA']").click()
# 等待3秒
time.sleep(10)
# 退出浏览器
driver.quit()